import { createRouter, createWebHistory } from 'vue-router'
import HomeView from '../views/HomeView.vue'
import SalaryView from '@/views/study/SalaryView.vue'
import SalavarView2 from '@/views/study/SalavarView2.vue'
import SalaryView3 from '@/views/study/SalaryView3.vue'
import SalaryView4 from '@/views/study/SalaryView4.vue'
import SalaryView5 from '@/views/study/SalaryView5.vue'
import StaffDetailView from '@/views/study/staff/StaffDetailView.vue'
import StaffDetailView2 from '@/views/study/staff/StaffDetailView2.vue'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      name: 'home',
      component: HomeView,
    },
    {
      path: '/about',
      name: 'about',
      // route level code-splitting
      // this generates a separate chunk (About.[hash].js) for this route
      // which is lazy-loaded when the route is visited.
      component: () => import('../views/AboutView.vue'),
    },
    {
      path: '/salary',
      name: 'salary',
      component: SalaryView,
    },
    {
      path: '/salary2',
      name: 'salary2',
      component: SalavarView2,
    },
    {
      path: '/salary3',
      name: 'salary3',
      component: SalaryView3,
    },
    {
      path: '/salary4',
      name: 'salary4',
      component: SalaryView4
    },
    {
      path: '/salary5',
      name: 'salary5',
      component: SalaryView5,
      children: [
        {
          path: '/staff',
          name: 'staff',
          component: StaffDetailView,
        },
        {
          path: '/staff2/:id?/:name/:salary',
          name: 'staff2',
          component: StaffDetailView2,
        }
      ]
    },
  ],
})

export default router
